package cinema.model;

import cinema.service.*;
import cinema.util.*;

public class AdminUser extends User {
    public AdminUser(String id, String username, String password, String phone) {
        super(id, username, password, UserType.ADMIN, phone);
    }

    @Override
    public void showMenu() {
        while (true) {
            System.out.println("\n===管理员菜单===");
            System.out.println("1. 用户管理 2. 修改密码 3. 退出");
            switch (InputUtil.readInt("请选择: ")) {
                case 1 -> UserService.manageUsers(this);
                case 2 -> {
                    String pwd = InputUtil.readLine("新密码: ");
                    changePassword(pwd);
                    Logger.log("修改管理员密码", username);
                }
                case 3 -> { return; }
            }
        }
    }
}